<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>方法</title>
</head>
<body>
<input type="button" onclick="fn1()">
<script>
    function fn1() {
        alert('fn1');
    }
    fn1();
    function fn4(x,y) {
        return x*y;
    }
    let result = fn4(5,9);
    console.log("result="+result);

    //第二种声明方法的方式
    let fn5 = function(name,age){
        console.log(name+":"+age);
    }
    fn5("诸葛亮",30);

    //第三种声明方法的方式
    let fn6 = new Function("name","age","console.log(name+':'+age)");
    fn6("刘备",18);
</script>
</body>
</html>